package com.msameer.gwttutor.server;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.view.client.ProvidesKey;

public class Customer {
	private static final List<Customer> All = new ArrayList<Customer>();
	
    /**
     * The key provider that provides the unique ID of a contact.
     */
    public static final ProvidesKey<Customer> KEY_PROVIDER = new ProvidesKey<Customer>() {
      public Object getKey(Customer item) {
        return item == null ? null : item.getId();
      }
    };
	
	private Integer id;
	private String name;
	
	public Customer(String name) {
		this();
		this.name = name;
	}
	
	public Customer() {
		this.id = All.size();
	
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Integer getId() {
		return id;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	
	public static List<Customer> getAll() {
		return All;
	}
	
	static {
		Customer.getAll().add(new Customer("Mohammed Sameer"));
		Customer.getAll().add(new Customer("Eman Moussa"));
		Customer.getAll().add(new Customer("Gogo"));
		Customer.getAll().add(new Customer("Dodo"));
	}
}
